﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SoftwareMonkeys.LogClimber.Entities;
using SoftwareMonkeys.LogClimber.Business;

namespace SoftwareMonkeys.LogClimber
{
    public partial class NewProjectDialog : Form
    {
        public LogProject Project;

        public NewProjectDialog()
        {
            InitializeComponent();
        }

        private void wwwDirectoryButton_Click(object sender, EventArgs e)
        {
            DialogResult result = wwwDirectoryDialog.ShowDialog();
            if (result == DialogResult.OK)
                wwwDirectoryBox.Text = wwwDirectoryDialog.SelectedPath;
        }

        private void NewProjectWindow_Load(object sender, EventArgs e)
        {

        }

        private void createButton_Click(object sender, EventArgs e)
        {
            Project = new LogProject();
            Project.Name = nameBox.Text;
            Project.WwwDirectory = wwwDirectoryBox.Text;

            LogProjectSaver saver = new LogProjectSaver();
            saver.Save(Project);

            this.Close();
        }
    }
}
